import { request } from '@/api/request';
import { APISAFEINDEX } from '@/common';

/**
 * @desc 企业安全指数等级列表
 */
type GradeType = {
  gradeColorBackground: string;
  gradeColorShape: string;
  sort: number;
  gradeName: string;
  startRatio: number;
  endRatio: number;
  showName: string;
};
export const getEntGrade = () =>
  request<GradeType[]>({
    method: 'get',
    url: `${APISAFEINDEX}safetyIndexGrade/list`,
  });
/**
 * @desc  企业安全指数等级设置
 */
export const setEntGrade = (data: any) =>
  request({
    url: `${APISAFEINDEX}safetyIndexGrade/setGrade`,
    data,
  });

export { GradeType };
